package com.jiazhong.常用类.String;
//2、将上题取到的字符串与“oi”连接保存于字符串str中，输出原串与新串。
public class Test02 {
    public static void main(String[] args) {
        String a = new String("abcdefzhig");
        String str="";
        String b=new String("oi");
        for (int i = 0; i < a.length(); i = i + 2) {
            String c = String.valueOf(a.charAt(i));
            System.out.print(" "+c);
            str=str.concat(c);
        }
        System.out.println();
        System.out.println(str);
        str=str.concat(b);
        System.out.println(str);
    }
}
